<template>
    <router-link v-for="user of users" :key="user.id" :to="`/user/${user.id}`" class="user-item">{{user.name}}</router-link>
</template>

<script setup>
    import {ref} from "vue"
    import api from "@/api/user";
    const users = ref(await api.all());
</script>

<style lang="scss" scoped>
    .user-item{
        background-color:#e67e22;
        color: #fff;
        padding:10px;
        margin-bottom: 10px;
        display: block;
    }
</style>